package com.iceland.common.rpc;

public class RpcMessageManagerHolder {

    static ThreadLocal<RpcMessageManager> threadLocal=new ThreadLocal<>();

    public static RpcMessageManager getRpcMessageManager(){
        return threadLocal.get();
    }
    public static void setRpcMessageManager(RpcMessageManager rpcMessageManager){
        threadLocal.set(rpcMessageManager);
    }

    /**
     * 防止threadLocal内存泄露
     */
    public static void clear(){
        threadLocal.remove();
    }
}
